﻿using Coldairarrow.Entity.DTO;
using Coldairarrow.Entity.PB;
using Coldairarrow.IBusiness.DTO;
using Coldairarrow.Util;
using Coldairarrow.Util.ClassLibrary;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Coldairarrow.Business.PB
{
    public partial interface IPB_DispatchBusiness
    {
        Task<PageResult<PB_Dispatch>> GetDataListAsync(PageInput<ConditionDTO> input);

        /// <summary>
        /// 获取派工信息
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<PageResult<PB_DispatchDTO>> GetDispatchDataListAsync(PageInput<PB_DispatchConditionDTO> input);
        Task<List<PB_DispatchDTO>> GetDataListInfo(List<string> ParentId);
        Task<PB_Dispatch> GetTheDataAsync(string id);
        Task AddDataAsync(PB_Dispatch data);
        Task UpdateDataAsync(PB_Dispatch data);
        Task DeleteDataAsync(List<string> ids);
        Task<List<PB_DispatchDTO>> Selectid(string id);
        Task<List<PB_DispatchDetailDTO>> SelectParint(string parint);
        Task<List<PB_DispatchDetailDTO>> SelectParints(string parints);

        /// <summary>
        /// 派工选择人员信息
        /// </summary>
        /// <param name="dispatchDate">派工日期</param>
        /// <returns></returns>
        Task<List<ScheduleDetailDTO>> GetScheduleDetailUserListAsync(string dispatchDate);
        /// <summary>
        /// 派工获取工序信息
        /// </summary>
        /// <returns></returns>
        Task<List<ProcecureSubTreeDTO>> GetTreeSubListAsyncs();
        /// <summary>
        /// 派工获取项目信息
        /// </summary>
        /// <returns></returns>
        Task<List<PB_ProjectDataDTO>> GetProjectAsync();
        /// <summary>
        /// 派工获取工件信息
        /// </summary>
        /// <param name="projectId">项目Id</param>
        /// <param name="subId">工序Id</param>
        /// <param name="input">筛选条件</param>
        /// <returns></returns>
        Task<PageResult<WorkpieceDTO>> GetMaterialAsync(string projectId, string subId, PageInput<PBMaterialConditionDTO> input);
        /// <summary>
        /// 获取派工单号
        /// </summary>
        /// <returns></returns>
        string GetWorkOrderNoAsync(RedisOptions _redisOptions);
        /// <summary>
        /// 保存派工及派工明细
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        Task AddData(PB_DispatchListDTO data);

        /// <summary>
        /// 判断员工是否有派工
        /// </summary>
        /// <param name="dispatchDate">日期</param>
        /// <param name="userid">员工ID</param>
        /// <returns></returns>
        Task<Object> GetUserWhetherDispatchAsync(string dispatchDate, string userid);

        /// <summary>
        /// 派工打印
        /// </summary>
        /// <param name="qrcode">二维码</param>
        /// <returns></returns>
        Task<List<PB_DispatchDataDTO>> GetDispatchListDataPrintAsync(string qrcode);

        /// <summary>
        /// 获取物料信息
        /// </summary>
        /// <param name="MaterialId"></param>
        /// <returns></returns>
        Task<List<PB_Material>> GetMaterialDataAsync(string MaterialId);

        /// <summary>
        /// 获取派工的任务单
        /// </summary>
        /// <param name="projectId">项目Id</param>
        /// <returns></returns>
        Task<List<PB_ProductionOrder>> GetProductionOrderListDataAsync(string projectId, string POName, DateTime? StateTime, DateTime? EndTime);
        /// <summary>
        /// 生产领料
        /// </summary>
        /// <param name="cateqrcode">任务单二维码</param>
        /// <returns></returns>
        Task<PB_DispatchDetailPDADTO> GetPDADataListInfo(string cateqrcode);

        Task<PB_DispatchDetailPDANumberDTO> GetPDADataMaterialListInfo(string localQrCode, string packqrcode);
        Task<bool> GetLocationProjectTruOrFalseAsync(string packqrcode, string cateqrcode, string localQrCode);
        Task UpdateStockUpDataAsync(DispatchDTO data);
        /// <summary>
        /// 获取生产任务单对应的包明细
        /// </summary>
        /// <param name="stockupQrCode"></param>
        /// <returns></returns>
        Task<List<PB_DispatchLoadListDataDTO>> GetStockUpDetailListDataAsync(string stockupQrCode);
        /// <summary>
        /// 删除备货单已出库的明细
        /// </summary>
        /// <param name="stockupQrCode">备货单二维码</param>
        /// <param name="packqrocde">包二维码</param>
        /// <param name="Nums">数量</param>
        /// <returns></returns>
        Task DeleteStockUpDetailListDataAsync(string stockupQrCode, string packqrocde, double nums);
        /// <summary>
        /// 下架出库提交
        /// </summary>
        /// <param name="stockupQrCode">备货单二维码</param>
        /// <returns></returns>
        Task SubmitStockUpDataAsync(string stockupQrCode);
        /// <summary>
        /// 取消
        /// </summary>
        /// <param name="stockupQrCode"></param>
        /// <returns></returns>
        Task CancelStockUpAsync(string stockupQrCode);
        /// <summary>
        /// 托盘领料扫描在制品流转卡
        /// </summary>
        /// <param name="carculqrcode"></param>
        /// <returns></returns>
        Task<PB_CirculationBillPDADTO> GetPDACarCulDataListInfo(string carculqrcode);
        /// <summary>
        /// 确认数量,下托盘
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        Task UpdateStockUpTrayDataAsync(DispatchDTO data);
        /// <summary>
        /// 派工单作废操作
        /// </summary>
        /// <param name="Id">派工单ID</param>
        /// <returns></returns>
        Task TovoidDispatch(string Id);

        /// <summary>
        /// 派工单选择工件
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<PageResult<DispatchMaterialDTO>> GetDispatchMaterialListAsync(PageInput<DispatchMaterialConditionDTO> input);

        /// <summary>
        /// 派工单选择隶属成品
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<PageResult<OrderMaterialDTO>> GetOrderMaterialListAsync(PageInput<DispatchMaterialConditionDTO> input);
        /// <summary>
        /// 验证是否已派工
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        Task<AjaxResult> SaveVerificationDispatch(VerificationDispatch data);

        #region  快速派工

        /// <summary>
        /// 快速派工保存
        /// </summary>
        /// <param name="data"></param>
        /// <param name="_redisOptions"></param>
        /// <returns></returns>
        Task SaveQuickDispatchAsync(QuickDispatch data, RedisOptions _redisOptions);
        /// <summary>
        /// 上件派工
        /// </summary>
        /// <param name="Data"></param>
        /// <returns></returns>
        Task<PieceDispatch> SavePieceDispatch(PieceDispatch Data, RedisOptions _redisOptions);
        /// <summary>
        /// 快速派工获取任务单明细
        /// </summary>
        /// <param name="OrderId">任务单Id</param>
        /// <returns></returns>
        Task<List<ProductionOrderDetailDTO>> GetProductionOrderDetailAsync(string OrderId);
        /// <summary>
        /// PDA上件派工
        /// </summary>
        /// <param name="QrCode"></param>
        /// <returns></returns>
        Task<List<PB_CirculationBillInfo>> GetCirculationBillInf(string QrCode);
        /// <summary>
        /// PDA上件部分派工
        /// </summary>
        /// <param name="QrCode"></param>
        /// <returns></returns>
        Task<List<PartialDispatch>> GetPartialDispatchList(string QrCode);

            /// <summary>
            /// 快速派工根据成品获取半成品信息
            /// </summary>
            /// <param name="input"></param>
            /// <returns></returns>
        Task<PageResult<OrderMaterialProductDTO>> GetOrderMaterialProductAsync(PageInput<OrderMaterialProductConditionDTO> input);

        /// <summary>
        /// 获取排班班组
        /// </summary>
        /// <param name="WorkShopId">车间Id</param>
        /// <returns></returns>
        Task<List<PB_ShiftType>> GetShiftTypeListAsync(string WorkShopId);

        /// <summary>
        /// 快速派工获取排班明细信息
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<PageResult<ScheduleDetailDTO>> GetScheduleDetailAsync(PageInput<ScheduleDetailConditionDTO> input);

        /// <summary>
        /// 获取任务单信息
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<PageResult<Entity.PB.PB_ProductionOrderDTO>> GetProductionOrderAsync(PageInput<PB_ProductionOrderConditionDTO> input);

        #endregion

        #region  原材料领料

        /// <summary>
        /// 原材料领料获取物料信息
        /// </summary>
        /// <param name="MaterialQrCode">物料二维码</param>
        /// <param name="LocaQrCode">货位二维码</param>
        /// <returns></returns>
        Task<RawStorMaterialDTO> GetRawMaterialDataAsync(string MaterialQrCode, string LocaQrCode);

        /// <summary>
        /// 原材料领料保存
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        Task SaveRawMaterialPickingAsync(RawMaterialDTO data);


        #endregion

        #region 流转卡初始化报工数据,反写生产任务单已生产数量
        /// <summary>
        /// 获取流转单信息
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<PageResultData<CirculationOrder>> GetCirculationOrderList(PageInput<CirculationOrderConditionDTO> input);

        /// <summary>
        /// 获取人员信息
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<PageResult<JobUserDTO>> GetJobUserListAsync(PageInput<ConditionDTO> input);


        /// <summary>
        /// 保存(反向生成上件派工数据,生成报工数据,反写生产任务单已生产数量)
        /// </summary>
        /// <param name="data"></param>
        /// <param name="_redisOptions"></param>
        /// <returns></returns>
        Task SaveCirBillJobDataAsync(CirBillJobData data, RedisOptions _redisOptions);

        #endregion

        #region 组装件领料

        /// <summary>
        /// 组装件获取包信息
        /// </summary>
        /// <param name="PackQrCode">包二维码</param>
        /// <param name="DispatchDetailQrCode">派工单明细二维码</param>
        /// <returns></returns>
        Task<BomPackDTO> GetBomPackDataAsync(string PackQrCode, string DispatchDetailQrCode);

        /// <summary>
        /// 组装件获取单个物料信息
        /// </summary>
        /// <param name="PackQrCode">物料二维码</param>
        /// <param name="DispatchDetailQrCode">派工单明细二维码</param>
        /// <returns></returns>
        Task<BomSingleMaterialDTO> GetBomSingleMaterialDataAsync(string PackQrCode, string DispatchDetailQrCode);

        /// <summary>
        /// 获取派工单领取明细
        /// </summary>
        /// <param name="DispatchDetailQrCode">派工单明细二维码</param>
        /// <returns></returns>
        Task<List<BomMaterialReceiveMaterialDTO>> GetBomMaterialReceiveListAsync(string DispatchDetailQrCode);

        /// <summary>
        /// 组装件领料保存
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        Task SaveBomMaterialDataAsync(BomReceiveData data);

        /// <summary>
        /// 组装件领料移除
        /// </summary>
        /// <param name="data"></param>
        /// <param name="DispatchDetailQrCode">派工单明细二维码</param>
        /// <returns></returns>
        Task DeleteBomMaterialReceiveAsync(BomMaterialReceiveMaterialDTO data,string DispatchDetailQrCode);

        /// <summary>
        /// 组装件领料提交
        /// </summary>
        /// <param name="DispatchDetailQrCode">派工单明细二维码</param>
        /// <returns></returns>
        Task SubmitBomMaterialReceiveAsync(string DispatchDetailQrCode);

        /// <summary>
        /// 组装件报工获取物料信息
        /// </summary>
        /// <param name="DispatchDetailQrCode">派工单明细二维码</param>
        /// <returns></returns>
        Task<BomMaterialWorkDTO> GetBomMaterialWorkDataAsync(string DispatchDetailQrCode);

        /// <summary>
        /// 组装件报工
        /// </summary>
        /// <param name="DispatchDetailQrCode">派工单明细二维码</param>
        /// <param name="PrintId">物料码打印机Id</param>
        /// <param name="StorId">仓库Id</param>
        /// <param name="Nums">报工数量</param>
        /// <param name="_mongodbOptions"></param>
        /// <param name="_redisOptions"></param>
        /// <returns></returns>
        Task SaveBomMaterialWorkAsync(string DispatchDetailQrCode, string PrintId, string StorId, double? Nums, MongoDBOptions _mongodbOptions, RedisOptions _redisOptions);

        /// <summary>
        /// 组装报工选择物料打印机
        /// </summary>
        /// <returns></returns>
        Task<List<PrintBomMaterialDTO>> GetPrintBomMaterialAsync();

        /// <summary>
        /// 组装报工选择包码打印机
        /// </summary>
        /// <returns></returns>
        Task<List<PrintBomMaterialDTO>> GetPrintBomPackAsync();

        #endregion

        /// <summary>
        /// 物料完工扫描流转卡生成收货单
        /// </summary>
        /// <param name="carculqrcode"></param>
        /// <returns></returns>
        Task<PB_CirculationBillPDADTO> GetPDACarCulDataListInfoDetail(string carculqrcode);
        Task AddScrappingProducts(ScrappingProducts data);
        Task AddProductsDetailReform(ProductsDetailReform data);
    }

    #region
    /// <summary>
    /// 派工领料单出库时传值
    /// </summary>
    public class DispatchDTO
    {
        /// <summary>
        /// 派工单二维码
        /// </summary>
        public string cateqrcode { get; set; }

        /// <summary>
        /// 包/物料二维码
        /// </summary>
        public string packqrcode { get; set; }

        /// <summary>
        /// 货位信息
        /// </summary>
        public string locaqrcode { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        public double? Nums { get; set; }
        /// <summary>
        /// 流转单二维码
        /// </summary>
        public string carculqrcode { get; set; }
    }

    /// <summary>
    /// 根据流转单领料,需要保存的数据
    /// </summary>
    public class DispatchRemarkDTO
    {
        /// <summary>
        /// 派工单id主
        /// </summary>
        public string DispatchId { get; set; }

        /// <summary>
        /// 派工单id从
        /// </summary>
        public string DispatchDetailId { get; set; }

        /// <summary>
        /// 领取人
        /// </summary>
        public string UserName { get; set; }

        /// <summary>
        /// 时间
        /// </summary>
        public DateTime? ReceiveTime { get; set; }
        /// <summary>
        /// 数量
        /// </summary>
        public double? ReadyNums { get; set; }
    }

    public class DispatchMaterialConditionDTO
    {
        public string Condition { get; set; }

        public string Keyword { get; set; }

        public string MaterialTypeId { get; set; }

        public string OrderId { get; set; }

        public Boolean? IsProduct { get; set; }
    }

    /// <summary>
    /// 派工单选择工件
    /// </summary>
    public class DispatchMaterialDTO
    {
        /// <summary>
        /// 物料ID
        /// </summary>
        public string MaterialId { get; set; }

        /// <summary>
        /// 物料名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 物料编码
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 物料规格
        /// </summary>
        public string Spec { get; set; }

        /// <summary>
        /// 长
        /// </summary>
        public Double? Length { get; set; }

        /// <summary>
        /// 宽
        /// </summary>
        public Double? Width { get; set; }

        /// <summary>
        /// 高
        /// </summary>
        public Double? Height { get; set; }

        /// <summary>
        /// 任务单明细id
        /// </summary>
        public string OrderDetailId { get; set; }

        /// <summary>
        /// 任务单Id
        /// </summary>
        public string OrderId { get; set; }

        /// <summary>
        /// 是否成品
        /// </summary>
        public Boolean? IsProduct { get; set; }

        /// <summary>
        /// 物料类型Id
        /// </summary>
        public string MaterialTypeId { get; set; }

        /// <summary>
        /// 组织Id
        /// </summary>
        public string DeptId { get; set; }
    }

    /// <summary>
    /// 派工单选择成品
    /// </summary>
    public class OrderMaterialDTO
    {
        /// <summary>
        /// 任务单Id
        /// </summary>
        public string OrderId { get; set; }

        /// <summary>
        /// 任务单明细Id
        /// </summary>
        public string OrderDetailId { get; set; }

        /// <summary>
        /// 物料Id
        /// </summary>
        public string MaterialId { get; set; }

        /// <summary>
        /// 物料名称
        /// </summary>
        public string MaterName { get; set; }

        /// <summary>
        /// 物料编码
        /// </summary>
        public string MaterCode { get; set; }

        /// <summary>
        /// 物料规格
        /// </summary>
        public string MaterSpec { get; set; }

        /// <summary>
        /// 计划数量
        /// </summary>
        public Double? Nums { get; set; }

        /// <summary>
        /// 物料Id
        /// </summary>
        public Double? Productionquantity { get; set; }

        /// <summary>
        /// 物料Id
        /// </summary>
        public Double? CompleteNums { get; set; }

    }
    public class VerificationDispatch {
       
        public List<OrderDetailList> Detaillist { get; set; }
    }
    public class OrderDetailList {
        public string OrderDetailId { get; set; }
        public List<VerificationDetail> DetailMater { get; set; }
    }

    public class VerificationDetail {
        /// <summary>
        /// 成品id
        /// </summary>
        public string SubordinateProduct { get; set; }
        /// <summary>
        /// 工件
        /// </summary>
        public string MaterialId { get; set; }
        /// <summary>
        /// 工序
        /// </summary>
        public string SubId { get; set; }
    }
    #endregion

    #region  快速派工

    /// <summary>
    /// 任务单派工
    /// </summary>
    public class QuickDispatch
    {
        /// <summary>
        /// 任务单Id
        /// </summary>
        public string OrderId { get; set; }

        /// <summary>
        /// 任务类型：0:翻新；1新制；2非生产
        /// </summary>
        public int? IsRefurbishment { get; set; }

        /// <summary>
        /// 项目Id
        /// </summary>
        public string ProjectId { get; set; }

        /// <summary>
        /// 隶属成品集合
        /// </summary>
        public List<SubordinateProductDTO> SubordinateProductList { get; set; }
    }

    /// <summary>
    /// 任务单派工明细
    /// </summary>
    public class SubordinateProductDTO
    {
        /// <summary>
        /// 派工日期
        /// </summary>
        public DateTime? DispatchDate { get; set; }

        /// <summary>
        /// 任务单明细Id
        /// </summary>
        public string OrderDetailId { get; set; }

        /// <summary>
        /// 隶属成品
        /// </summary>
        public string SubordinateProduct { get; set; }

        /// <summary>
        /// 员工Id
        /// </summary>
        public string StaffId { get; set; }

        /// <summary>
        /// 员工姓名
        /// </summary>
        public string StaffName { get; set; }

        /// <summary>
        /// 班别
        /// </summary>
        public string TeamType { get; set; }

        /// <summary>
        /// 工件Id
        /// </summary>
        public string MaterialId { get; set; }

        /// <summary>
        /// 工序ID
        /// </summary>
        public string SubId { get; set; }

        /// <summary>
        /// 生产数量
        /// </summary>
        public Double? Nums { get; set; }

        /// <summary>
        /// 打孔数量
        /// </summary>
        public Double? PunchingNums { get; set; }

        /// <summary>
        /// 打孔位置
        /// </summary>
        public string PunchingPosition { get; set; }

        /// <summary>
        /// 物料长度
        /// </summary>
        public Double? MaterialLength { get; set; }

        /// <summary>
        /// 孔径
        /// </summary>
        public string Aperture { get; set; }

        /// <summary>
        /// 材质
        /// </summary>
        public string Texture { get; set; }

        /// <summary>
        /// 派工模式:0-数量,1-重量
        /// </summary>
        public int? ModeType { get; set; }

    }

    /// <summary>
    /// 根据任务单获取任务单明细信息
    /// </summary>
    public class ProductionOrderDetailDTO
    {
        /// <summary>
        /// 任务单id
        /// </summary>
        public string OrderId { get; set; }

        /// <summary>
        /// 任务单明细id
        /// </summary>
        public string OrderDetailId { get; set; }

        /// <summary>
        /// 成品Id
        /// </summary>
        public string SubordinateProduct { get; set; }

        /// <summary>
        /// 成品名称
        /// </summary>
        public string SubordinateProductName { get; set; }

        /// <summary>
        /// 生产数量
        /// </summary>
        public double? Productionquantity { get; set; }

        /// <summary>
        /// 成品编码
        /// </summary>
        public string ProductCode { get; set; }

        /// <summary>
        /// 规格
        /// </summary>
        public string Spec { get; set; }

        /// <summary>
        /// 材质
        /// </summary>
        public string Ofmaterial { get; set; }

    }

    /// <summary>
    /// 根据成品id获取半成品信息
    /// </summary>
    public class OrderMaterialProductDTO
    {
        /// <summary>
        /// 成品Id
        /// </summary>
        public string SubordinateProduct { get; set; }

        /// <summary>
        /// 半成品Id
        /// </summary>
        public string MaterialId { get; set; }

        /// <summary>
        /// 半成品名称
        /// </summary>
        public string MaterialName { get; set; }

        /// <summary>
        /// 半成品编码
        /// </summary>
        public string MaterialCode { get; set; }

        /// <summary>
        /// 半成品规格
        /// </summary>
        public string MaterialSpec { get; set; }

        /// <summary>
        /// 半成品生产单位ID
        /// </summary>
        public string productionId { get; set; }

        /// <summary>
        /// 半成品生产单位名称
        /// </summary>
        public string productionName { get; set; }

        /// <summary>
        /// 半成品理论重量
        /// </summary>
        public Double? Weight { get; set; }

        /// <summary>
        /// 工序Id
        /// </summary>
        public string ProcecureId { get; set; }

        /// <summary>
        /// 长度
        /// </summary>
        public Double? Length { get; set; }

        /// <summary>
        /// 是否成品
        /// </summary>
        public Boolean? IsProduct { get; set; }


        /// <summary>
        /// 是否半成品
        /// </summary>
        public Boolean? IsVirtualkey { get; set; }

        /// <summary>
        /// 已派工数量
        /// </summary>
        public Double? DispatchNums { get; set; }

        /// <summary>
        /// 物料使用状态(0未启用 ，1启用)
        /// </summary>
        public Boolean? UsageStatus { get; set; }

    }

    /// <summary>
    /// 获取登录人车间的排班明细
    /// </summary>
    public class ScheduleDetailDTO
    {
        /// <summary>
        /// 排班明细Id
        /// </summary>
        public string Id { get; set; }

        /// <summary>
        /// 员工Id
        /// </summary>
        public string UserId { get; set; }

        /// <summary>
        /// 员工姓名
        /// </summary>
        public string RealName { get; set; }

        /// <summary>
        /// 班别Id
        /// </summary>
        public string Type { get; set; }

        /// <summary>
        /// 班别名称
        /// </summary>
        public string TypeName { get; set; }

        /// <summary>
        /// 车间Id
        /// </summary>
        public string WorkShopID { get; set; }

        /// <summary>
        /// 车间名称
        /// </summary>
        public string WorkShopName { get; set; }

        /// <summary>
        /// 排班日期
        /// </summary>
        public string WorkDate { get; set; }
        /// <summary>
        /// 角色
        /// </summary>
        public string roleId { get; set; }
        /// <summary>
        /// 车间名称
        /// </summary>
        public string DepartmentName { get; set; }
    }

    /// <summary>
    /// 快速派工选择工件搜索条件
    /// </summary>
    public class OrderMaterialProductConditionDTO
    {
        public string Condition { get; set; }

        public string Keyword { get; set; }

        /// <summary>
        /// 成品Id
        /// </summary>
        public string SubordinateProduct { get; set; }

        /// <summary>
        /// 是否成品
        /// </summary>
        public Boolean? IsProduct { get; set; }

        /// <summary>
        /// 任务单Id
        /// </summary>
        public string OrderId { get; set; }
    }

    /// <summary>
    /// 快速派工获取排班明细信息搜索条件
    /// </summary>
    public class ScheduleDetailConditionDTO
    {
        public string Condition { get; set; }

        public string Keyword { get; set; }

        /// <summary>
        /// 派工日期
        /// </summary>
        public string WorkDate { get; set; }

        /// <summary>
        /// 车间ID
        /// </summary>
        public string WorkShopId { get; set; }

        /// <summary>
        /// 班别Id
        /// </summary>
        public string TypeId { get; set; }

        public List<string> Roid { get; set; }
    }

    #endregion

    #region  原材料领料

    /// <summary>
    /// 原材料领料查询库存物料信息
    /// </summary>
    public class RawStorMaterialDTO
    {
        /// <summary>
        /// 物料Id
        /// </summary>
        public string MaterialId { get; set; }

        /// <summary>
        /// 货位Id
        /// </summary>
        public string LocalId { get; set; }

        /// <summary>
        /// 物料名称
        /// </summary>
        public string MaterialName { get; set; }

        /// <summary>
        /// 物料编码
        /// </summary>
        public string MaterialCode { get; set; }

        /// <summary>
        /// 物料规格
        /// </summary>
        public string MaterialSpec { get; set; }

        /// <summary>
        /// 库存数量
        /// </summary>
        public Double? Nums { get; set; }

    }

    /// <summary>
    /// 原材料领料保存传值
    /// </summary>
    public class RawMaterialDTO
    {
        /// <summary>
        /// 派工单明细二维码
        /// </summary>
        public string DispatchDetailQrCode { get; set; }

        /// <summary>
        /// 货位二维码
        /// </summary>
        public string LocaQrCode { get; set; }

        /// <summary>
        /// 物料Id
        /// </summary>
        public string MaterialId { get; set; }

        /// <summary>
        /// 领取数量
        /// </summary>
        public Double? Nums { get; set; }

    }

    /// <summary>
    /// 查询原材料被领取的派工信息
    /// </summary>
    public class RawMaterialPickingDTO : PB_DispatchDetail
    {
        /// <summary>
        /// 设计清单Id
        /// </summary>
        public string DesignId { get; set; }

    }

    #endregion

    #region 流转卡初始化报工数据,反写生产任务单已生产数量

    public class CirculationOrderConditionDTO
    {
        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime? OrderTimeStart { get; set; }
        /// <summary>
        /// 结束时间
        /// </summary>
        public DateTime? OrderTimeEnd { get; set; }

        /// <summary>
        /// 工序Id
        /// </summary>
        public string SubId { get; set; }

        public string Condition { get; set; }
        public string Keyword { get; set; }

    }

    public class JobUserDTO
    {
        /// <summary>
        /// 员工Id
        /// </summary>
        public string Id { get; set; }

        /// <summary>
        /// 员工姓名
        /// </summary>
        public string RealName { get; set; }

        /// <summary>
        /// 部门Id
        /// </summary>
        public string DepartmentId { get; set; }

        /// <summary>
        /// 部门名称
        /// </summary>
        public string DepartmentName { get; set; }

    }

    public class CirBillJobData
    {
        /// <summary>
        /// 日期
        /// </summary>
        public string JobDate { get; set; }

        /// <summary>
        /// 派工人员Id
        /// </summary>
        public List<string> StaffId { get; set; }

        /// <summary>
        /// 派工人员姓名
        /// </summary>
        public List<string> StaffName { get; set; }

        /// <summary>
        /// 质检人员Id
        /// </summary>
        public string QualityUserId { get; set; }

        /// <summary>
        /// 统计人员Id
        /// </summary>
        public string StatisticsUserId { get; set; }

        /// <summary>
        /// 车间Id
        /// </summary>
        public string WorkShopId { get; set; }

        /// <summary>
        /// 班别Id
        /// </summary>
        public string TeamType { get; set; }

        /// <summary>
        /// 工序
        /// </summary>
        public string SubId { get; set; }

        public List<CirBillData> CirBillData { get; set; }

    }

    public class CirBillData
    {
        /// <summary>
        /// 流转单Id
        /// </summary>
        public string CirBillId { get; set; }

        /// <summary>
        /// 派工数量
        /// </summary>
        public double? Nums { get; set; }

    }

    public class CirculationBillJobDTO : PB_CirculationBill
    {
        /// <summary>
        /// 项目Id
        /// </summary>
        public string ProjectId { get; set; }
    }


    #endregion

    #region 组装件领料DTO

    /// <summary>
    /// 组装件扫描包
    /// </summary>
    public class BomPackDTO
    {
        /// <summary>
        /// 包Id
        /// </summary>
        public string PackId { get; set; }

        /// <summary>
        /// 包二维码
        /// </summary>
        public string PackQrCode { get; set; }

        /// <summary>
        /// 包名称
        /// </summary>
        public string BoxName { get; set; }

        /// <summary>
        /// 包装数量
        /// </summary>
        public double? Nums { get; set; }

        public List<BomPackMaterialDTO> BomPackMaterial { get; set; }

    }

    /// <summary>
    /// 组装件领料包内明细
    /// </summary>
    public class BomPackMaterialDTO
    {
        /// <summary>
        /// 包Id
        /// </summary>
        public string PackId { get; set; }
        /// <summary>
        /// 物料Id
        /// </summary>
        public string MaterialId { get; set; }

        /// <summary>
        /// 物料名称
        /// </summary>
        public string MaterialName { get; set; }

        /// <summary>
        /// 物料编码
        /// </summary>
        public string MaterialCode { get; set; }

        /// <summary>
        /// 物料规格
        /// </summary>
        public string MaterialSpec { get; set; }

        /// <summary>
        /// 成品编码
        /// </summary>
        public string ProductCode { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        public double? Nums { get; set; }

        /// <summary>
        /// 未备数量
        /// </summary>
        public double? RemainingQuantity { get; set; }

    }

    /// <summary>
    /// 获取派工单需要组装的物料信息
    /// </summary>
    public class BomSubMaterialDTO
    {
        /// <summary>
        /// 物料Id
        /// </summary>
        public string MaterialId { get; set; }

        /// <summary>
        /// 组装物料需要数量
        /// </summary>
        public double? Nums { get; set; }
    }

    /// <summary>
    /// 组装件单个物料领取信息
    /// </summary>
    public class BomSingleMaterialDTO
    {
        /// <summary>
        /// 派工单明细Id
        /// </summary>
        public string DispatchDetailId { get; set; }

        /// <summary>
        /// 物料Id
        /// </summary>
        public string MaterialId { get; set; }

        /// <summary>
        /// 物料名称
        /// </summary>
        public string MaterialName { get; set; }

        /// <summary>
        /// 物料编码
        /// </summary>
        public string MaterialCode { get; set; }

        /// <summary>
        /// 物料规格
        /// </summary>
        public string MaterialSpec { get; set; }

        /// <summary>
        /// 成品编码
        /// </summary>
        public string ProductCode { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        public double? Nums { get; set; }

        /// <summary>
        /// 未领取数量
        /// </summary>
        public double? RemainingQuantity { get; set; }
    }


    /// <summary>
    /// 组装件领料
    /// </summary>
    public class BomReceiveData
    {
        /// <summary>
        /// 包码/物料码
        /// </summary>
        public string PackQrCode { get; set; }

        /// <summary>
        /// 派工单明细二维码
        /// </summary>
        public string DispatchDetailQrCode { get; set; }

        /// <summary>
        /// 物料数量
        /// </summary>
        public Double? Nums { get; set; }

        /// <summary>
        /// 货位二维码
        /// </summary>
        public string LocaQrCode { get; set; }

    }

    /// <summary>
    /// PDA组装领料列表
    /// </summary>
    public class BomMaterialReceiveMaterialDTO
    {
        /// <summary>
        /// 领取Id
        /// </summary>
        public string Id { get; set; }

        /// <summary>
        /// 包Id
        /// </summary>
        public string PackId { get; set; }

        /// <summary>
        /// 物料Id
        /// </summary>
        public string MaterialId { get; set; }

        /// <summary>
        /// 成品Id
        /// </summary>
        public string JobId { get; set; }

        /// <summary>
        /// 时间
        /// </summary>
        public string CreateTime { get; set; }

        /// <summary>
        /// 物料编码
        /// </summary>
        public string MaterialCode { get; set; }

        /// <summary>
        /// 物料名称
        /// </summary>
        public string BoxName { get; set; }

        /// <summary>
        /// 物料规格
        /// </summary>
        public string MaterialSpec { get; set; }

        /// <summary>
        /// 成品编码
        /// </summary>
        public string ProductCode { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        public double? Nums { get; set; }

        /// <summary>
        /// 货位Id
        /// </summary>
        public string LocalId { get; set; }

        /// <summary>
        /// 货位名称
        /// </summary>
        public string StorAreaName { get; set; }

    }

    /// <summary>
    /// 组转件报工物料信息
    /// </summary>
    public class BomMaterialWorkDTO
    {
        /// <summary>
        /// 派工单明细Id
        /// </summary>
        public string DispatchDetailId { get; set; }

        /// <summary>
        /// 物料Id
        /// </summary>
        public string MaterialId { get; set; }

        /// <summary>
        /// 物料名称
        /// </summary>
        public string MaterialName { get; set; }

        /// <summary>
        /// 物料编码
        /// </summary>
        public string MaterialCode { get; set; }

        /// <summary>
        /// 物料规格
        /// </summary>
        public string MaterialSpec { get; set; }

        /// <summary>
        /// 成品码
        /// </summary>
        public string ProductCode { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        public double? Nums { get; set; }

        /// <summary>
        /// 是否为成品
        /// </summary>
        public Boolean? IsProduct { get; set; }

        /// <summary>
        /// 单价
        /// </summary>
        public double? Price { get; set; }

        /// <summary>
        /// 是否为单个物料 0否 1是
        /// </summary>
        public Boolean? IsSingle { get; set; }

    }

    /// <summary>
    /// 组装报工选择打印机
    /// </summary>
    public class PrintBomMaterialDTO
    {
        /// <summary>
        /// 打印机Id
        /// </summary>
        public string PrintId { get; set; }

        /// <summary>
        /// 打印机名称
        /// </summary>
        public string PrintName { get; set; }

    }

    /// <summary>
    /// 获取派工的领料数量
    /// </summary>
    public class BomMaterialReceiveDTO
    {
        public double? Nums { get; set; }
    }

    #endregion
}